package org.hot100_3;

public class leetcode206 {
    public ListNode reverseList(ListNode head) {

        ListNode pre =null;

        ListNode curr = head;

        ListNode next = null;

        while (curr!=null){
            next = curr.next;
            curr.next=pre;
            pre=curr;
            curr=next;
        }

        return pre;
    }
}
